﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RIDA.Globals;
using System.Windows;

namespace RIDA.DiagramDesigner.ViewModel
{
   
    [Serializable]
    public class ConnectorViewModel : ViewModelBase
    {
        private DesignerItemViewModel _designerItemViewModel;

        public DesignerItemViewModel DesignerItemViewModel
        {
            get { return _designerItemViewModel; }
            set { _designerItemViewModel = value; }
        }

        // center position of this Connector relative to the DesignerCanvas
        private Point position;
        public Point Position
        {
            get { return position; }
            set
            {
                if (position != value)
                {
                    position = value;
                    OnNotifyPropertyChanged("Position");
                }
            }
        }

        private List<ConnectionViewModel> connections;
        public List<ConnectionViewModel> Connections
        {
            get
            {
                if (connections == null)
                    connections = new List<ConnectionViewModel>();
                return connections;
            }
        }

        private ConnectorOrientation _orientation;

        public ConnectorOrientation Orientation
        {
            get { return _orientation; }
            set { _orientation = value; OnNotifyPropertyChanged("Orientation"); }
        }

        private VerticalAlignment _verticalAlignment;

        public VerticalAlignment VerticalAlignment
        {
            get { return _verticalAlignment; }
            set { _verticalAlignment = value; OnNotifyPropertyChanged("VerticalAlignment"); }
        }

        private HorizontalAlignment _horizontalAlignment;

        public HorizontalAlignment HorizontalAlignment
        {
            get { return _horizontalAlignment; }
            set { _horizontalAlignment = value; OnNotifyPropertyChanged("HorizontalAlignment"); }
        }

        private double _designerItemLeft;
        public double DesignerItemLeft
        {
            get { return _designerItemLeft; }
            set { _designerItemLeft = value; OnNotifyPropertyChanged("DesignerItemLeft"); }
        }

        private double _designerItemTop;
        public double DesignerItemTop
        {
            get { return _designerItemTop; }
            set { _designerItemTop = value; OnNotifyPropertyChanged("DesignerItemTop"); }
        }

        private Size _designerItemSize;
        public Size DesignerItemSize
        {
            get { return _designerItemSize; }
            set { _designerItemSize = value ; OnNotifyPropertyChanged("DesignerItemSize"); }
        }
    }
}
